package com.chentf.behavioral.responsibilitychain.code.demo01;

public class SchoolMasterApprover extends Approver {

    public SchoolMasterApprover(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest purchaseRequest) {
        // 校长审批
        if (purchaseRequest.getPrice() > 30000) {
            System.out.println("请求编号 id = " + purchaseRequest.getId() + " 被 " + this.name + " 处理");
        } else {
            // 如果不是校长审批的请求，交给下一个处理者
            nextApprover.processRequest(purchaseRequest);
        }
    }
}
